package com.frxuexi.shop2307.view

import com.frxuexi.lib_base.entity.PinBean
import com.frxuexi.lib_base.entity.PinDetailBean
import com.frxuexi.lib_base.http.ApiService
import com.frxuexi.lib_base.mvvm.BaseViewModel
import com.frxuexi.lib_base.utils.SignLiveData
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class PinViewModel @Inject constructor(val apiService: ApiService):BaseViewModel(){

    val getPinShopsData=SignLiveData<PinBean>()
    val pinError=SignLiveData<String>()
    fun getPinShops(){
        httpRequest({apiService.getPinShops()},getPinShopsData::postValue,pinError::postValue)
    }

    val pinDetailData=SignLiveData<PinDetailBean>()
    fun getPinDetail(id:Int){
        httpRequest({apiService.getPinDetail(id)},pinDetailData::postValue,pinError::postValue)
    }
}